/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.bean.User;
/*    */ import com.newcrm.db.CustomerManager;
/*    */ import com.newcrm.db.ImportantDateManager;
/*    */ import com.newcrm.db.TaskManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class ShowNotificationNum extends AbstractAction
/*    */ {
/*    */   public ShowNotificationNum(AbstractHttpServlet servlet)
/*    */   {
/* 24 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 30 */     User user = super.getLoginUser(request);
/*    */ 
/* 33 */     CustomerManager manager = new CustomerManager();
/* 34 */     int num = manager.getNeedContactCustomerNum(user.userId, 
/* 35 */       -1, null, null);
/*    */ 
/* 38 */     TaskManager taskManager = new TaskManager();
/* 39 */     int taskNum = taskManager.getNotFinishTaskNum(user.userId, 
/* 40 */       1);
/*    */ 
/* 43 */     ImportantDateManager importantDateManager = new ImportantDateManager();
/* 44 */     int importantDateNum = importantDateManager
/* 45 */       .getImportantDateNum(user.userId);
/*    */ 
/* 47 */     response.setContentType("text/html;charset=utf-8");
/* 48 */     PrintWriter out = response.getWriter();
/* 49 */     JSONObject jsonObject = new JSONObject();
/* 50 */     jsonObject.put("error", "0");
/* 51 */     jsonObject.put("contactNum", Integer.valueOf(num));
/* 52 */     jsonObject.put("taskNum", Integer.valueOf(taskNum));
/* 53 */     jsonObject.put("importantDateNum", Integer.valueOf(importantDateNum));
/* 54 */     out.println(jsonObject);
/* 55 */     out.flush();
/* 56 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ShowNotificationNum
 * JD-Core Version:    0.6.1
 */